package ru.neoflex.chugunov.input;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

import javax.swing.JFileChooser;

import ru.neoflex.chugunov.Scan;

public abstract class InputSource implements Input {

	public abstract Scan read() throws FileNotFoundException, IOException;

	public String openFile() {
		String result = "";
		String initialDirectory = "";
		JFileChooser fileopen = new JFileChooser(initialDirectory);
		fileopen.setFileSelectionMode(JFileChooser.FILES_ONLY);
		fileopen.setAcceptAllFileFilterUsed(false);
		int ret = fileopen.showDialog(null, "Choose File");
		if (ret == JFileChooser.APPROVE_OPTION) {
			result = fileopen.getSelectedFile().getAbsolutePath();
		}
		return result;
	}
}
